package cn.henu.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.henu.dao.UserDao;
import cn.henu.model.User;

@Service("userService")
public class UserServiceImpl extends UserBaseService implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public Long listUserCount(User user) {
        return userDao.listUserCount(user);
    }

    @Override
    public List<Map<String, Object>> listUser(User user) {
        return userDao.listUser(user);
    }

    @Override
    public User createUser(final User user) {
        User u = null;
        u = userDao.createUser(user);
        return u;
    }

    @Override
    public User updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public Integer deleteUser(final User user) {
        Integer row = 0;
        row = userDao.deleteUser(user);
        return row;
    }

    @Override
    public List<User> getUser(User user) {
        return userDao.getUser(user);
    }

}
